package cn.ctyun.ipush.service.impl;

import cn.ctyun.ipush.dao.YixinTokenDao;
import cn.ctyun.ipush.model.YixinTokenModel;
import cn.ctyun.ipush.service.YixinTokenService;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 * User: Liu
 * Date: 2016/7/25
 * Time: 16:16
 * To change this template use File | Settings | File Templates..
 */
@Service("yixinTokenService")
public class YixinTokenServiceImpl implements YixinTokenService{

    /* 日志对象 */
    private final Logger LOG = LoggerFactory.getLogger(YixinTokenServiceImpl.class);

    @Autowired
    private YixinTokenDao yixinTokenDao;

//    public void save(YixinTokenModel yixinTokenModel){
//
//    }
public int update(YixinTokenModel yixinTokenModel) {
    if (StringUtils.isEmpty(yixinTokenModel.getYixinTokenModelId())) {
        throw new RuntimeException("YixinToken 主键ID 不存在");
    }
    return yixinTokenDao.update(yixinTokenModel);
}
    public YixinTokenModel querySingleResult(String yixinTokenId){
        return yixinTokenDao.querySingleResult(yixinTokenId);
    }
}
